from manim import *

class Example01(Scene):
    def construct(self):
        # 创建x，y坐标轴
        axis = Axes(x_range=[-3, 3, 1], y_range=[-3, 3, 1])
        curve = axis.plot(lambda x: (x+2)*x*(x-2)/2, color=RED)
        area = axis.get_area(curve, x_range=[-2, 0])
        # self.add(axis,curve,area)
        self.play(Create(axis,run_time=3),Create(curve,run_time=5))
        self.wait(2)
        self.play(FadeIn(area))

